From 0b783f67500f4ebcf77524b6fade868910f53eec Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 11 Aug 2017 17:05:55 +0800 Subject: [PATCH] meson.build: Fix Vulkan library detection on Visual Studio The Vulkan .lib file that is supplied by the LunarG Vulkan SDK is vulkan-1.lib, not vulkan.lib, so make sure we look for the right libraries when building on Visual Studio (I am not sure whether the LunarG SDK will work for MinGW/mingw-w64 builds, as only Visual Studio .lib files are provided). Note that this will require one to set LIB and INCLUDE appropriately to find the Vulkan .lib and header files, and possibly PATH if one's video drivers do not contain the Vulkan runtime DLL. https://bugzilla.gnome.org/show_bug.cgi?id=785210 --- meson.build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 6d849b9910..7bc891247a 100644 --- a/meson.build +++ b/meson.build @@ -508,12 +508,19 @@ cdata.set('HAVE_GIO_UNIX', giounix_dep.found()) # TODO: move to gsk subfolder maybe? Or will it be used elsewhere too? have_vulkan = false vulkan_lib = [] + +if cc.get_id() == 'msvc' + vulkan_libname = 'vulkan-1' +else + vulkan_libname = 'vulkan' +endif + enable_vulkan = get_option('enable-vulkan') if enable_vulkan != 'no' - vulkan_lib = cc.find_library('vulkan', required: false) + vulkan_lib = cc.find_library(vulkan_libname, required: false) if vulkan_lib.found() and cc.has_function('vkCreateInstance', dependencies: vulkan_lib) and cc.has_header('vulkan/vulkan.h') have_vulkan = true - pc_gdk_extra_libs += ['-lvulkan'] + pc_gdk_extra_libs += ['-l@0@'.format(vulkan_libname)] elif enable_vulkan == 'yes' error('Vulkan support not found, but was explicitly requested.') endif -- 2.30.2